package com.sc.javaee.service.impl;

import com.sc.javaee.mapper.CartMapper;
import com.sc.javaee.pojo.Cart;
import com.sc.javaee.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartServiceImpl implements CartService {
    @Autowired
    CartMapper mapper;
    @Override
    public int add(Cart c) {
        return mapper.insertSelective(c);
    }

    @Override
    public Cart select(Integer id) {
        return mapper.select(id);
    }

    @Override
    public int update(Cart c) {
        return mapper.updateByPrimaryKeySelective(c);
    }

    @Override
    public int batchUpdate(Cart c) {
        return mapper.batchUpdate(c);
    }

    @Override
    public int batchAdd(Cart c) {
        return mapper.insertSelective(c);
    }

    @Override
    public List<Cart> selectCard() {
        return mapper.selectCard();
    }

    @Override
    public int batchDel(Integer[] ids) {
        return mapper.batchDel(ids);
    }
}
